if(window.HashChangeEvent)(function () {
    window.addEventListener("hashchange",function (event) {
        let curURL = document.URL;
        let cPage = /#p=(\d{1})/g.exec(curURL)[1];
        renderHtml(cPage);
    })
}());
!function pageInit() {
    let curURL = document.URL;
    let cHash = /#p=(\d{1})/g.exec(curURL);
    let cPage = cHash && cHash.length > 0? cHash[1]:0;
    if(cPage == "0") {
        setHash(1);
    }else {
        renderHtml(cPage, 1);
    }
}();
$(document).delegate('#clickBtn','click',function() {
    let curURL = document.URL;
    let cPage = /#p=(\d{1})/g.exec(curURL)[1];
    if (cPage < 3) {
        setHash(parseInt(cPage)+1);
    }else {
        // alert("后续功能待续...")
        location.href = '/show/1'
    }
});
function setHash(value) {
    location.hash = "p=" + value;
}
function renderHtml(cPage, init) {
    if(init == "1") {
        $('#textarea .text'+cPage).css('animation-name', 'ulShow');
    }else {
        let pre = parseInt(cPage) - 1;
        $('#textarea .text'+pre).css('animation-name', 'ulHide');
        $('#textarea .text'+cPage).css('animation-name', 'ulShow');
    }
}